home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / assembler-tools / pllbc2p / pllbc2p_howtouse.txt < prev    next >
Text File  |  1980-01-10  |  9KB  |  297 lines

  1.  
  2.  *=-----------------------------------------------------------------------=*
  3.  
  4.                   >> Quick 'How to Use' Pllb-C2p V1.04 <<
  5.  
  6.                          Last updated: 27-4-1996
  7.  
  8.  *=-----------------------------------------------------------------------=*
  9.  
  10.  
  11.  ** PLEASE NOTE: For Pllb-C2p to work correctly, (it does actually work :)
  12.     your display has to be setup in a normal bitplane fashion and *NOT* in
  13.     interleave format.  Plus, Your screen should *NOT* use a modulo.
  14.  
  15.     Also, if you use my (dodgy ;) blitter routine to transfer (copy/resort) 
  16.     the bitplanes from the TEMP_IMAGE_BUFFER to YOUR SCREEN, well then, 
  17.     it expects all the bitplanes to be allocated in a linear fashion.
  18.  
  19.  
  20.  ** PLEASE NOTE: That if your planning to use the DELTANULLSKIP c2p routine,
  21.     that you firstly need to allocate it's delta buffer.
  22.  
  23.     This buffer should be in fastram, and no smaller than 
  24.     ((screenwidth*screenheight)/4)= Delta NullSkip buffer size.
  25.  
  26.     If you don't allocate this buffer, and try to use the DELTANULLSKIP
  27.     routines, you'll *CRASH* your machine.
  28.  
  29.   
  30.  ** PLEASE NOTE: I suggest that before you really get started in using
  31.     PLLB-C2P that you actually have a look through at least one or two of
  32.     the C2P routines first, just to make sure that you at least understand
  33.     the basic theory of how it works.
  34.  
  35.     Plus, it'll help me better the package, with the IDEAS, OPT's, FLAMES ;)
  36.     etc etc.... that i'm all too sure i'll receive....  ;)
  37.  
  38.  
  39.  
  40. ; -------------------------------------------------------------------------
  41. ; -------------------------------------------------------------------------
  42.  
  43.  
  44. ; Ok, Well since PLLB-C2P has turned into something more than just a few
  45. ; C2p routines, i'd better briefly run through how you should actually
  46. ; use it... 
  47.  
  48.  
  49.  
  50. ; Well firstly, you need to ALLOCATE the fast ram buffers, i've provided
  51. ; a couple of simple ALLOC and DE-ALLOC routines which will attempt to
  52. ; grab as many blocks of fastram as possible (remember there 512K blocks)
  53.  
  54. ; If this routine FAILS and can't alloc any 512k buffers, well then
  55. ; i'm sorry about your out of luck.. ;)
  56.  
  57. ; if this happens  'Pllb_C2p_enabled_flag'.w  = NULL (FAILED)
  58.  
  59.  
  60. Demo_Startup:
  61.  
  62.     bsr Pllb_Alloc_fast_buffers
  63.  
  64.         tst.w Pllb_C2p_Enabled_Flag
  65.         beq.b pllb_ram_alloc_failed
  66.  
  67.             bsr The_Demo_Init
  68.  
  69.  
  70. pllb_ram_alloc_failed:
  71.  
  72.         bsr Pllb_DeAlloc_fast_buffers    
  73.  
  74.     rts            ; DEMO FAILED or FINISHED  ;)
  75.  
  76.  
  77.  
  78. ; --------------------------------------------------------------------------
  79. ; --------------------------------------------------------------------------
  80. ; --------------------------------------------------------------------------
  81. ; --------------------------------------------------------------------------
  82.  
  83.  
  84. The_DemoInit:
  85.  
  86.  
  87.     ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  88.     ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  89.     ; <<<<<<<<<<<<<<<<<<<< INIT PLLB-C2P START >>>>>>>>>>>>>>>>>>>>>
  90.     ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  91.     ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  92.  
  93.     ; if you should wish to hard code PLLB-C2p into always running
  94.     ; with a predefined number of FASTRAM buffers, well feel free.
  95.     ; but you'll also have to alloc/dealloc those buffers yourself.
  96.  
  97.     ; (I.e. you wouldn't call the PLLB_ALLOC & DEALLOC routines supplied)
  98.  
  99.     ; Insert the addresses of each of the fastram buffers into
  100.     ; pllb's fastram address pointers..
  101.  
  102.     ; make sure you alloc the buffers in order, ie. A,B,C,D
  103.  
  104.     ; if not, you'll surely crash the machine ;)
  105.     
  106.         ;move.l #YourFastBufferA,Pllb_C2p_FastBuffer_PointerA
  107.         ;move.l #YourFastBufferB,Pllb_C2p_FastBuffer_PointerB
  108.         ;move.l #YourFastBufferC,Pllb_C2p_FastBuffer_PointerC
  109.         ;move.l #YourFastBufferD,Pllb_C2p_FastBuffer_PointerD
  110.  
  111.  
  112.     ; There are 4 valid Fastbuffer tag's 512k,1024k,1536k & 2048k
  113.  
  114.     ; The Tag needs to be set correctly to the number of buffers
  115.     ; you've allocated. 
  116.  
  117.         ;move.w #Pllb_C2P_Tag2048k,PllB_C2p_FastRam_BUfferSize
  118.  
  119.  
  120.     ; Turn PLLB C2P ON
  121.  
  122.         ;move.w #Pllb_c2p_active,Pllb_C2p_Enabled_Flag
  123.  
  124.  
  125.  
  126.     ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  127.     ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  128.     ; <<<<<<<<<<<<<<<<<<<< INIT PLLB-C2P START >>>>>>>>>>>>>>>>>>>>>
  129.     ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  130.     ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  131.  
  132.     ; >>>> Set the Number of Bitplanes you wish to use  <<<
  133.     ; >>>> only 4bit/6bit and 8bit are valid in this version
  134.  
  135.  move.w #Pllb_C2P_ColourDepth8bit,Pllb_C2p_ColourDepth
  136.  
  137.     ; >>>> Set your required pixel output width <<<<
  138.     ; >>>> only  'Pixelwidth1','Pixelwidth2' & 'Pixelwidth4' are valid
  139.  
  140.  move.w #Pllb_C2P_PixelWidth1,Pllb_C2p_PixelWidth
  141.  
  142.     ; >>>> Set the C2P type
  143.     ; >>>> Only NORMAL,DELTA and NULLSKIP are valid
  144.     
  145.  move.w #Pllb_C2P_Type_NORMAL,Pllb_C2p_Conversion_Type
  146.  
  147.  
  148.         ; **** NOTE: if you select DELTANULLSKIP c2p, you'll have to
  149.         ; >>>> allocate it a DELTA buffer, and then place the address of
  150.         ; >>>> this buffer into 
  151.         ; >>>> 'Pllb_C2p_DeltaNullSkip_buffer_pointer'
  152.  
  153.  
  154.         ;move.l $4.w,a6        
  155.         ;move.l #(ScreenWidthInPixels*ScreenHeight)/4,d0        
  156.         ;move.l #MEMF_FAST,d1            
  157.         ;jsr AllocMem(a6)        
  158.  
  159.     ;  tst.l d0
  160.     ;  beq FAILED_DELTANULLSKIP_BUFFER_ALLOC
  161.  
  162.         ;move.l d0,Pllb_C2p_DeltaNullSkip_buffer_pointer
  163.  
  164.  
  165.  
  166.  
  167.  
  168.     ; >>>> init the size of your chunky frame buffer <<<
  169.  
  170.     ; >>>> width should be an even MULT of 16 pixels !
  171.  
  172.  move.w #320,PLLB_C2P_ChunkyScreenWidth
  173.  move.w #255,PLLB_C2P_ChunkyScreenHeight
  174.  
  175.     ; >>>> Init Bitplane size
  176.            
  177.  move.w #40*255,PLLB_C2P_BitPLane_Size
  178.  
  179.     ; >>>> Pass the CHIPRAM address of the Temp Image Buffer
  180.     ; >>>> You'll have to allocate this buffer and then place the
  181.     ; >>>> address in 'PLLB_C2P_TEMP_IMAGE_BUFFER"
  182.  
  183.     ; >>>> make sure also that you align this value to 64bits.. for
  184.     ; >>>> the best possible performance... 
  185.  
  186.  ; I.e. something like this will do !!
  187.  
  188.  move.l $4.w,a6        
  189.  move.l #((ScreenWidthInPixels/8)*ScreenHeight)*planes),d0        
  190.  move.l #MEMF_CHIP,d1            
  191.  jsr AllocMem(a6)        
  192.  
  193.      tst.l d0
  194.      beq FAILED
  195.  
  196.   move.l d0,Pllb_C2P_Temp_Image_buffer
  197.  
  198.  
  199.  
  200.     ; >>>> This code aligns *all* of the c2p routines for their best
  201.     ; >>>> possible performance, Well I hope so anyway.
  202.       
  203.   jsr Pllb_C2P_Routine_alignment_system
  204.  
  205.  
  206.     ; >>>> This init's the supplied Blitter bitplane transfer variables
  207.  
  208.     ; >>>> i.e. max numb of bitplanes, size of frame... etc etc
  209.  
  210.   jsr Pllb_c2p_Init_BlitterResort_Table
  211.  
  212.  
  213.     ; >>>> And finally (if all goes well) this will init the FastRam
  214.     ; >>>> precalc buffers
  215.  
  216.   jsr Pllb_C2p_init_precalc_tables
  217.  
  218.  
  219.  
  220.     ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  221.     ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  222.     ; <<<<<<<<<<<<<<<<<<<< INIT PLLB-C2P DONE >>>>>>>>>>>>>>>>>>>>>>
  223.     ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  224.     ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234. Main_Demo_LP:        
  235.  
  236.         jsr Pllb_C2p_blitter_resort_frame
  237.  
  238.     ; >>> if your using the code 'as is', well then you have to
  239.     ; >>> call this routine as much as possible...
  240.  
  241.     ; >>> it's purpose is to check the blitters progress and if it's
  242.     ; >>> finished copying a bitplane, well then, it INIT's the next
  243.         ; >>> bitplane to transfer, if need be.. 
  244.  
  245.  
  246.     ; For Example, in the Zrotate/Flexer demo I included in this package
  247.     ; well, all I did was call this routine at the end of drawing each
  248.     ; zrotated scanline into the chunky buffer.
  249.  
  250.     ; If your Cpu is quite fast, and you've been able to render the new
  251.         ; Chunky frame buffer before the blitter has completed shifting
  252.     ; the last frame, well unfortunately at the moment you'll have to
  253.         ; wait till it's complete....
  254.  
  255.     ; There may be a way to avoid waiting via using a triple buffering
  256.         ; system, but i've not tried it as yet. Sorry.
  257.  
  258.   
  259.  
  260.  
  261.     ; >>>>>>>>>>>>>>>>>>>>>> PLLB-C2p Frame Buffer <<<<<<<<<<<<<<<<<
  262.  
  263.     ; >>> Before you call the Handle PLLB-C2P routine
  264.     ; >>> you first need to tell it the ADDRESS of your
  265.     ; >>> Chunky buffer(s) (if your using DELTA c2p then you'd
  266.         ; >>> Have two Source chunky buffers)
  267.  
  268.     move.l Chunky_Buffer1,Pllb_C2P_Chunky_Frame_bufferA
  269.     move.l Chunky_Buffer2,Pllb_C2P_Chunky_Frame_bufferB
  270.  
  271.     ; >>>> Also you need to tell is where it's meant to OUTPUT
  272.     ; >>>> the final C2p'd Image.. I.E. The address of your PLANAR
  273.     ; >>>> frame buffer.
  274.     
  275.     Move.l Current_Picture,Pllb_C2P_Display_Frame_buffer
  276.  
  277.     bsr Pllb_C2p_process_frame_buffer
  278.  
  279.  
  280.     ; >>>>>>>DONE>>>>>>>>> PLLB-C2p Frame Buffer <<<<<<<<<<<<<<<DONE
  281.  
  282.  
  283.  
  284.  
  285.         tst.b Is_The_DEMO_Over
  286.         bne.b Main_DEMO_LP
  287.  
  288.     rts
  289.  
  290.  
  291.  
  292.  *=-----------------------------------------------------------------------=*
  293.  
  294.                                 T H E    E N D    
  295.  
  296.  *=-----------------------------------------------------------------------=*
  297.